package com.wwg.cms.bo.entity;
import com.wwg.cms.bo.*;
/**
 *create auto on 2010-8-31 16:43:18
 *create by wwl
 * accessitem
 * 
 * @hibernate.class table="accessitem" *  mutable="true" 
 *  proxy="com.wwg.cms.bo.entity.AccessitemEntity" 
 */
public class AccessitemEntity implements Accessitem{

	 private Long id;
	 private Long parentId;
	 private String name;
	 private Role role;
	 private String code;
	 private Long mask;
	 private String type;
	/**
	 *
 	 *
	 * @hibernate.id  column="id"
	 *  unsaved-value="null"
 	 *  generator-class="native"
	 * @return Long 
	 */
	public Long getId() {
		return id;
	}
	public void setId(Long id){
		this.id = id;
	}
	/**
	 *
 	 *
	 * @hibernate.property column="parent_id"
	 * @return Long 
	 */
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId){
		this.parentId = parentId;
	}
	/**
	 *显示名称
 	 *
	 * @hibernate.property column="name"
	 * @return String 
	 */
	public String getName() {
		return name;
	}
	public void setName(String name){
		this.name = name;
	}
	/**
	 *
 	 *
	 * @hibernate.many-to-one  column="role_id"  
	 *      class = "com.wwg.cms.bo.entity.RoleEntity"
	 * @return Role 
	 */
	public Role getRole() {
		return role;
	}
	public void setRole(Role roleId){
		this.role = roleId;
	}
	/**
	 *权限标识
 	 *
	 * @hibernate.property column="code"
	 * @return String 
	 */
	public String getCode() {
		return code;
	}
	public void setCode(String code){
		this.code = code;
	}
	/**
	 *权限标记 由2进制转化
 	 *
	 * @hibernate.property column="mask"
	 * @return Long 
	 */
	public Long getMask() {
		return mask;
	}
	public void setMask(Long mask){
		this.mask = mask;
	}
	/**
	 *授权类型
 	 *
	 * @hibernate.property column="type"
	 * @return String 
	 */
	public String getType() {
		return type;
	}
	public void setType(String type){
		this.type = type;
	}
  @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AccessitemEntity that = (AccessitemEntity) o;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? AccessitemEntity.class.hashCode()+id.hashCode() : AccessitemEntity.class.hashCode();
    }


}


